This invention relates generally to video game systems and more particularly to game cards therefor.
A game card is used to interface external game controllers to personal computers. These game controllers are typically used to provide input to a video game or simulation program running on the personal computer. The game card provides a standard interface to the game controllers as described in U.S. Pat. No. 5,245,320 issued to Bouton. The standard game card interface includes four discrete inputs and four analog or variable inputs. The discrete inputs are used to input discrete digital signals, such as produced by switches, to the personal computer. The analog inputs are used to input continuously variable inputs such as those generated by potentiometers.
The personal computer periodically polls the discrete inputs of the game card to determine the state of the corresponding discrete input devices. Reading these discrete inputs directly presents no problem because the discrete switch outputs are in fact digital signals that can be read directly by the personal computer microprocessor on its data bus. The microprocessor, however, cannot directly determine the state of the input devices coupled to the analog inputs because the purely digital microprocessor cannot accept analog signals.
To allow the microprocessor to determine the state of the input devices coupled to the analog inputs, the game card includes a timer circuit that converts the analog signal level to corresponding pulse width. The timer signal is initially asserted responsive to a "write" to the game card by the microprocessor. A "write" is an output operation performed by the microprocessor responsive to execution of a write instruction ("OUT") fetched from memory. A write to the game card, which is located at a predetermined address in the PC's memory map, generates a plurality of control signals that enable the game card to receive the written data. Similarly, a "read" is an input operation performed by the microprocessor responsive to the execution of a read instruction ("IN") fetched from memory. A read from the game card, i.e., at the predetermined address, enables the game card to provide the requested data to the microprocessor.
The "write" sets a one shot RC circuit in the timer which causes the timer signal to be asserted. The signal thereafter decays as a decaying exponential function of the analog signal level. Thus, the higher the analog signal level, the longer the decay of the timer signal. The microprocessor thereafter continuously polls the timer signal until it detects the timer signal deasserted. The personal computer can then determine the analog signal level from the pulse width of the timer signal. This sequence is shown in FIG. 1.
FIG. 1 shows a conventional method employed by the microprocessor for processing the analog input signals of the game card. First, a counter is initialized to zero in 12. Next, the usual microprocessor interrupts are disabled in 14 to ensure that the routine is not preempted by an interrupt service routine. If the interrupts were not disabled, the computer would lose its frame of reference during an interrupt service routine and thereby compromise the accuracy of the pulse width determination. Next, the microprocessor fires the single shots of the timer at 16 by writing to a predetermined address in the game card. In an IBM-compatible personal computer this address is equal to 0201H. The microprocessor then enters a loop comprising steps 18 and 20 where the timer signal is read and, if asserted, i.e. high, the counter is incremented. This sequence continues until the timer signal is deasserted, at which point the interrupts are reenabled in 22. Thereafter, the analog signal level is calculated based on the counter value. This calculation is in two steps. First the timer signal pulse width is determined. This pulse width is determined by multiplying the counter value by the time per loop iteration. Once the timer signal pulse width is determined, the corresponding analog signal level is ascertained by a predetermined function, typically residing in a lookup table.
There are several problems with the above-described method. The first is that the interrupts must be disabled to maintain accuracy. If the interrupts were not disabled, and the procedure was interrupted in its inner loop, for example, the timer signal would continue to decay while the microprocessor was servicing the interrupt. This lost time would compromise the accuracy of the resulting analog signal level calculation. The problem with disabling interrupts is that other tasks that are interrupt driven go unserviced while the interrupts are disabled. For example, in a video game, the screen is typically updated responsive to an interrupt. Thus, while the microprocessor is processing the timer signals, the screen goes unupdated. This can result in choppy images being displayed, which compromises the life likeness and continuity of the video game. This problem is exacerbated by modern pre-emptive multi-tasking operating systems which depend heavily on interrupts.
Another problem with the prior art approach is that the counter value can become extremely large in fast personal computers. The increase in clock rates and I/O speeds means the personal computer can read the game card rapidly, thereby increasing the counter value accordingly. As the counter value gets above a certain point, the computations involved in determining the analog signal level become complex as well. In particular, full 32-bit multiplication is required to determine the timer pulse width. This added complexity further increases the time required to process the analog inputs of the game card.
Accordingly, a need remains for a game card that does not need to disable interrupts and yet maintains a high degree of accuracy in determining the analog input signal levels.